<%@ taglib prefix="shiro"  uri="http://shiro.apache.org/tags" %>
<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2019-07-01
  Time: 13:32
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java"  %>

<%
    String pash = request.getContextPath();
    String basepash = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + pash + "/";
%>
<html>
<head>
    <base href="<%=basepash%>">
    <%@include file="/publs.jsp"%>
    <title>Title</title>
    <style>
        /*.ivu-table .demo-table-info-row td{*/
            /*color: #ff090f;*/
        /*}*/
        /*.ivu-table .demo-table-error-row td{*/
            /*background-color: #ff6600;*/
            /*color: #fff;*/
        /*}*/
        /*.ivu-table .demo-table-error-rows td{*/
            /*background-color: gold;*/
            /*color: #fff;*/
        /*}*/
        /*.ivu-table .demo-table-error-rowssss td{*/
            /*background-color: rgba(138, 145, 137, 0.71);*/
            /*color: #fff;*/
        /*}*/
    </style>
</head>
<body>
    <div id="root">
        <Modal :mask-closable="false" v-model="shouhideasdasdasdadas" title="医药质检" @on-ok="onokshouhideasdasdasdadas">
            <i-form :label-width="80" :inner="true" >
                <form-item label="是否通过">
                    <Radio-Group v-model="zhijianss.qualState">
                        <Radio :label="1">
                            <Icon type="md-male"></Icon>
                            <span>是</span>
                        </Radio>
                        <Radio :label="2">
                            <Icon type="md-female"></Icon>
                            <span>否</span>
                        </Radio>
                    </Radio-Group>
                </form-item>
                <form-item label="质检结果">
                    <i-input type="textarea" v-model="zhijianss.qualComment"></i-input>
                </form-item>
                <%--<form-item label="全检/抽检">--%>
                    <%--<i-input v-model=""></i-input>--%>
                <%--</form-item>--%>
            </i-form>
        </Modal>



        <Modal :mask-closable="false" v-model="shouhide" title="请说明理由" @on-ok="onokshouhideasdas">
            <i-form :label-width="80" :inner="true" >
                <%--<form-item label="是否通过">--%>
                    <%--<Radio-Group v-model="zhijianss.qualState">--%>
                        <%--<Radio :label="1">--%>
                            <%--<Icon type="md-male"></Icon>--%>
                            <%--<span>是</span>--%>
                        <%--</Radio>--%>
                        <%--<Radio :label="2">--%>
                            <%--<Icon type="md-female"></Icon>--%>
                            <%--<span>否</span>--%>
                        <%--</Radio>--%>
                    <%--</Radio-Group>--%>
                <%--</form-item>--%>
                <form-item label="理由">
                    <i-input type="textarea" v-model="zhijian.comment"></i-input>
                </form-item>
                <%--<form-item label="全检/抽检">--%>
                <%--<i-input v-model=""></i-input>--%>
                <%--</form-item>--%>
            </i-form>
        </Modal>



        <Modal :mask-closable="false" v-model="chakanshouhide" title="理由">
            <i-form :label-width="80" :inner="true" >
                <%--<form-item label="是否通过">--%>
                <%--<Radio-Group v-model="zhijianss.qualState">--%>
                <%--<Radio :label="1">--%>
                <%--<Icon type="md-male"></Icon>--%>
                <%--<span>是</span>--%>
                <%--</Radio>--%>
                <%--<Radio :label="2">--%>
                <%--<Icon type="md-female"></Icon>--%>
                <%--<span>否</span>--%>
                <%--</Radio>--%>
                <%--</Radio-Group>--%>
                <%--</form-item>--%>
                <form-item label="理由">
                    <i-input type="textarea" disabled v-model="zhijian.comment"></i-input>
                </form-item>
                <%--<form-item label="全检/抽检">--%>
                <%--<i-input v-model=""></i-input>--%>
                <%--</form-item>--%>
            </i-form>
        </Modal>









        <Modal :mask-closable="false" v-model="shouhideasdasd"   width="60%" title="录入药品信息" @on-ok="piliangluru">
            <%--<i-button size="small" type="primary" @click="piliangluru" style="margin-bottom: 10px">批量录入</i-button>--%>
            <i-form :label-width="80" :inner="true">
                <i-table @on-selection-change="onselect" height="500px" :data="xuanzeyaopinshuju" :columns="xuanzeyaopinshujucolunmsss">
                    <%--<template slot="caozuossluru" slot-scope="{row}">--%>
                        <%--<i-button size="small" type="primary" @click="piliangluruss(row)">录入</i-button>--%>
                    <%--</template>--%>
                </i-table>
            </i-form>
        </Modal>


        <Modal :mask-closable="false"  v-model="shouhides" @on-visble-change="clear" title="录入采购单" width="100%" @on-ok="tianjiacaigoudan" style="margin-top: -100px">
            <i-form :label-width="80" :inner="true">
                <%--<form-item label="供应商">--%>
                        <%--<i-select v-model="gonygyingshangid" style="width: 300px">--%>
                            <%--<i-option v-for="item in gongYingShangSelect" :value="item.id">{{item.companyName}}</i-option>--%>
                        <%--</i-select>--%>
                <%--</form-item>--%>
                <form-item label="采购人">
                    <i-input v-model="caigouren" disabled style="width: 300px"></i-input>
                    </i-select>
                </form-item>
                    <form-item label="是否紧急">
                        <Radio-Group v-model="shifoujinji">
                            <Radio :label="1">
                                <span>是</span>
                            </Radio>
                            <Radio :label="0">
                                <span>否</span>
                            </Radio>
                        </Radio-Group>
                    </form-item>
                    <%--<form-item label="总价格">--%>
                        <%--{{zongjiagessss}}--%>
                    <%--</form-item>--%>
                <form-item label="添加药品">
                    <i-button icon="md-add" @click="luruyaopinxinxi">录入</i-button>
                    <i-button @click="piliangshanghu">批量删除</i-button>
                </form-item>
                <form-item label="信息列表">
                    <i-table @on-selection-change="onselectchangesyaopinshujucolunmsss" height="500" :data="yaopinshuju" :columns="yaopinshujucolunmsss">
                        <template slot="caozuos" slot-scope="{row}">
                            <i-button size="small"  type="primary" @click="deldeldel(row)">删除</i-button>
                        </template>
                        <template slot="shulaing" slot-scope="{row,index}">
                            <Input-Number   v-model="row.shu"  @on-change="onchangesNumber(row,index)"style="width: 150px" type="number"></Input-Number>
                        </template>
                    </i-table>
                </form-item>
            </i-form>
        </Modal>


        <Drawer title="数量统计" :closable="false" v-model="value1">
            <p>未提价:{{aaaa}}</p>
                <p>质检完毕:{{bbbb}}</p>
            <p>采购完毕:{{cccc}}</p>
                <%--let aaaa = 0;//未提价--%>
                <%--let bbbb = 0;//质检完毕--%>
                <%--let cccc = 0;//采购完毕--%>
        </Drawer>

        <Row style="margin: 20px">
            <shiro:hasPermission name="luRuXinXi:luRuXinXi">
            <i-col span="2">
                <i-button icon="md-add" type="primary" size="small" @click="luRuXinXi">录入采购单</i-button>
            </i-col>
            <%--<i-col span="2">--%>
                <%--<i-button @click="value1 = true" size="small" type="primary">数量统计</i-button>--%>
            <%--</i-col>--%>
            </shiro:hasPermission>
         </Row>

        <Row style="margin: 20px">
            <%--<shiro:hasPermission name="luRuXinXi:luRuXinXi">--%>
                <%--<i-col >--%>
                    <%--<i-button icon="md-add" type="primary" size="small" @click="luRuXinXi">录入采购单</i-button>--%>
                <%--</i-col>--%>
                <%--<i-col>--%>
                    <%--<i-button @click="value1 = true" type="primary">数量统计</i-button>--%>
                <%--</i-col>--%>
            <%--</shiro:hasPermission>--%>
            <i-col>
                <i-table :row-class-name="classname" :height="heights" style="margin-top:20px;margin-right: 50px;" :data="datasasd" :columns="colunmsss" border>
                    <template slot="caozuo" slot-scope="{row}">
                        <i-button size="small" type="primary" @click="chakan(row)" icon="md-albums">查看</i-button>
                        <i-button type="primary" size="small" @click="exportData('pdf',row)">打印</i-button>
                        <i-button type="primary" size="small" @click="exportData('xls',row)">导出</i-button>
                        <shiro:hasPermission name="caigouyuande:yuanyin">
                            <%--只能是采购员--%>
                            <i-button v-if="row.dingdanStar=='1'" size="small" type="error" @click="geilingdaotiajiao(row)">提交</i-button>
                            <i-button v-if="row.dingdanStar=='3'" size="small" type="error" @click="caigouwanbi(row)">采购完毕</i-button>
                        </shiro:hasPermission>

                        <i-button v-if="row.dingdanStar=='4'" size="small" @click="chakanyuanyinbupizhun(row)" type="error">查看原因</i-button>
                        <shiro:hasPermission name="jinlishifou:pizhuan">

                        <%--只能是经理--%>
                        <i-button v-if="row.dingdanStar=='2'" size="small" @click="pizhun(row)" type="error">批准</i-button>
                        <i-button v-if="row.dingdanStar=='2'" size="small" @click="bupizhun(row)" type="error">不批准</i-button>
                        </shiro:hasPermission>

<shiro:hasPermission name="zhijian:add">
<%--只能是质检员--%>
                        <i-button v-if="row.dingdanStar=='5'&&row.purstate!='1'" size="small" type="warning" @click="zhijianzhijian(row)">质检</i-button>
    <i-button disabled v-if="row.dingdanStar=='5'&&row.purstate=='1'" size="small" type="warning" @click="zhijianzhijian(row)">质检完毕</i-button>
    </shiro:hasPermission>


    <%--只能是质检员和采购员--%>



                    <%--<i-button v-if="row.dingdanStar=='3'" title="123123146" size="small">可以采购</i-button>--%>

                    <%--<i-button v-if="row.comment==0" size="small" type="error" @click="jiaohuo(row)">交货</i-button>--%>

                            <%--row.qualState=='1'&&row.purstate!='0'&&--%>
                        <%--<i-button v-if="row.dingdanStar=='3'" size="small" type="warning" @click="zhijianzhijian(row)">质检</i-button>--%>

                            <%--<i-button v-if="row.shenhecishu=='1'&&row.qualState=='2'" size="small" type="warning" @click="zhijianzaicishnehe(row)">再次质检</i-button>--%>

                            <%--<i-button v-if="row.comment=='3'&&row.qualState=='2'" size="small" type="warning" @click="tuihuo(row)">退货</i-button>--%>


                    </template>
                    <template slot="caigouzhuantai" slot-scope="{row}">
                        <%--{{row.purstate=="0"?"未审核":"已审核"}}--%>
                            <span v-if="row.dingdanStar=='3'">批准(可以采购)</span>
                            <span v-if="row.dingdanStar=='4'">不批准</span>
                            <span v-if="row.dingdanStar=='5'">采购完毕</span>
                            <span v-if="row.dingdanStar=='1'">未提交</span>
                            <span v-if="row.dingdanStar=='2'">已提交</span>
                            <span v-if="row.qualState=='1'">未入库</span>
                            <span v-if="row.qualState=='2'">已入库</span>


                        <%--<span v-if="row.qualState=='1'&&row.purstate!='0'&&row.comment=='3'">:未入库</span>--%>
                        <%--<span v-if="row.qualState=='1'&&row.purstate!='0'&&row.comment=='4'">:已入库</span>--%>
                    </template>
                    <template slot="caigoujinjiputong" slot-scope="{row}">
                        {{row.purjistate=="0"?"普通":"紧急"}}
                    </template>
                </i-table>
                <page :total="totals"  @on-change="onchenge" :page-Size="pageSize" show-sizer :page-size-opts="[5,10,15,20]" @on-page-size-change="onPageSizeChange"></page>
            </i-col>
        </Row>
    </div>
    <script>
        let _this = null;
        new Vue({
            el:"#root",
            data:{
                aaaa:0,
                bbbb:0,
                cccc:0,
                shouhideasdasd:false,
                datasasd:[],
                pageNo:0,
                totals:20,
                zhiji:{},
                chakanshouhide:false,
                colunmsss:[
                    {
                      title:"订单号",
                      key:"cgoId",
                        sortable: true
                    },
                    {
                        title:"采购员",
                        key:"anames"
                    },{
                        title:"状态",
                        key:"purstate",
                        slot:"caigouzhuantai"
                    },{
                        title:"紧急/普通",
                        key:"purjistate",
                        slot:"caigoujinjiputong"
                    },{
                        title:"质检结果",
                        key:"qualComment",
                        tooltip:true
                    },{
                        title:"质检人",
                        key:"zhijianren",
                    },{
                        title:"总价格",
                        key:"zongjiage"
                    },{
                        title:"录入时间",
                        key:"atime",
                        sortable: true
                    },{
                        title:"操作",
                        slot:"caozuo",
                        width:"300px"
                    }
                ],
                heights:700,
                pageSize:20,
                total:10,
                zhijian:{},
                shouhide:false,
                danweisss:[],
                gongYingShangSelect:[],
                shouhides:false,
                yaopinshuju:[],
                leibie:[],
                luruxinxishuzu:[],
                yaopinshujucolunmsss:[
                    {
                        width:"80",
                        type:"selection"
                    },
                    {
                        title:"药品编号",
                        key:"drugsid"
                    },{
                        title:"药品名称",
                        key:"drugsName"
                    },{
                        title:"规格",
                        key:"specifications"
                    },{
                        title:"单价",
                        key:"danjia"
                    },
                    {
                        title:"数量",
                        slot:"shulaing"
                    },
                    // {
                    //     title:"合计",
                    //     key:"danjia*numberNumber",
                    //     render(h,{row}){
                    //         return h("span",row.danjia*row.shu);
                    //     }
                    // },
                    // {
                    //     title:"单价",
                    //     key:"price"
                    // },{
                    //     title:"售价",
                    //     key:"prices"
                    // },{
                    //     title:"类别",
                    //     key:"categoryName"
                    // },
                    {
                        title:"操作",
                        slot:"caozuos"
                    }
                ],
                //以下是录入数据库的数据
                gonygyingshangid:"",
                caigouren:"",
                disabledtrue:false,
                disabledtruess:"质检",
                onselectchangesya:[],
                shouhideasdasdasdadas:false,
                number:0,
                xuanzeyaopinshuju:[],
                rows:{},
                shifoujinji:0,
                // zongjiagessss:0,
                zhiji:{},
                xuanzeyaopinshujucolunmsss:[
                    {
                        width:"80",
                        type:"selection"
                    },{
                        title:"药品编号",
                        key:"drugsid"
                    },{
                        title:"药品名称",
                        key:"drugsName"
                    },{
                        title:"药品规格",
                        key:"specifications"
                    },
                    {
                        title:"存放仓库",
                        key:"wname"
                    }
                    // ,{
                    //     title:"操作",
                    //     slot:"caozuossluru"
                    // }
                ],
                value1:false,
                zhijianss:{
                    qualState:1
                }
            },
            methods:{
                onchenge(size){
                    this.pageNo = size;
                    this.chaxunselectcaigoudingan();
                },
                onPageSizeChange(size){
                    this.pageSize = size;
                    this.chaxunselectcaigoudingan();
                },
                gongYingShangSelectFa(){
                    axios.get("${cxy}selectGongYingShang?companyName=&name=&phone=&pageNo=0&pageSize=9999999").then(({data})=>{
                        this.gongYingShangSelect = data.obj.list;
                    })
                },
                caigourens(){
                    axios.get("users/atcurrentUser").then(({data})=>{
                        this.caigouren = data.anames;
                    })
                },
                luRuXinXi(){
                    this.shouhides = true;
                    this.shanchusuoyou();
                    // this.zongjiagessss = 0;
                },
                luruyaopinxinxi(){
                    this.xuanzeyaopinshujuasd();
                    this.shouhideasdasd = true;
                },
                leibies(){
                    axios.get("yaopinleixing").then(({data})=>{
                        this.leibie = data.obj;
                    })
                },
                danweis(){
                    axios.get("selectdanwei").then(({data})=>{
                        this.danweisss = data.obj;
                    })
                },
                xuanzeyaopinshujuasd(){
                    axios.get("xuanzeyaopinshujuasd").then(({data})=>{
                        this.xuanzeyaopinshuju = data.obj;
                    })
                },
                onselect(selection){
                    this.luruxinxishuzu = selection;
                    // console.log(this.luruxinxishuzu);
                },

                piliangluru(){
                    if(this.luruxinxishuzu.length>=1){
                        for (let i = 0; i < this.luruxinxishuzu.length; i++) {
                                    // console.log(this.luruxinxishuzu[i]);
                                    axios.post("xunigouwu",this.luruxinxishuzu[i]).then(({data})=>{
                                        _this.selectxunigouwu();
                                    })
                                }
                    }

                },
                piliangluruss(row){
                    axios.post("xunigouwu",row).then(({data})=>{
                        _this.selectxunigouwu();
                    })
                },
                selectxunigouwu(){
                    axios.get("/selectxunigouwu").then(({data})=>{
                        this.yaopinshuju = data;
                        // console.log(data.shu)
                        // let zong = 0;
                        // for (let i = 0; i < data.length; i++) {
                        //     var zhi = data[i].danjia * 1;
                        //     zong += zhi;
                        // }
                        // this.zongjiagessss = zong;
                        // console.log(data);
                        // data.zongjiage
                        // this.zongjiagessss
                    })
                },
                deldeldel(row){
                    iview.Modal.confirm({
                        title:"提示!",
                        content:"是否删除",
                        onOk(){
                            axios.post("/deldelxunigouwuididid",row).then(({data})=>{
                                // console.log(data)
                                _this.selectxunigouwu();
                            })
                        }
                    })
                },
                onchangesNumber(row,index){
                //     row.shu = row.shu;
                // console.log(row)
                    // row.numberNumber = this.rows.numberNumber ;
                    axios.post("updasesss",row).then(({data})=>{
                        // axios.get("/selectxunigouwu").then(({data})=>{
                        //     this.yaopinshuju = data;
                            // console.log(data.shu)
                        // this.yaopinshuju[index].shus = row.shu;
                        //     let zong = 0;
                        //     for (let i = 0; i < this.yaopinshuju.length; i++) {
                        //         console.log(this.yaopinshuju[i].shus)
                        //         var zhi = this.yaopinshuju[i].danjia * this.yaopinshuju[i].shus;
                        //         zong += zhi;
                        //     }
                        //     this.zongjiagessss = zong;
                             // console.log( this.zongjiagessss);
                             // data.zongjiage
                             // this.zongjiagessss
                        // })
                    })
                },
                onselectchangesyaopinshujucolunmsss(select){
                    this.onselectchangesya = select;
                    // console.log(this.onselectchangesya)
                    // onselectchangesya
                },
                piliangshanghu(){
                        // console.log(this.onselectchangesya.length)
                    if(this.onselectchangesya.length<=0){
                        return;
                    }
                    var params= this.onselectchangesya.map(row=>{
                        return "ids="+row.id;
                    }).join("&");
                    iview.Modal.confirm({
                        title:"提示!",
                        content:"是否删除",
                        onOk(){
                            axios.get("piliangshanchu?"+params).then(({data})=>{
                                _this.selectxunigouwu();
                                _this.onselectchangesya = [];
                                // iview.Message.info("1")
                            })
                        }
                    })
                },
                tianjiacaigoudan(){
                    let shihoujinhuo = "进货";
                    axios.get("jinxingcaigou?ids="+this.shifoujinji+"&pageNo="+this.pageNo+"&pageSize="+this.pageSize+"&shihoujinhuo="+shihoujinhuo).then(({data})=>{
                        this.datasasd = data.obj.list;
                        this.heights = data.obj.list.length*48+40;
                        this.totals = data.obj.tatle;
                        this.shanchusuoyou();

                        let a = 0;
                        let b = 0;
                        let c = 0;
                        for (let i = 0; i < this.datasasd.length; i++) {
                            // console.log(this.datasasd[i].dingdanStar)
                            // console.log(this.datasasd[i].purstate)
                            if(this.datasasd[i].dingdanStar=='1'){
                                a++;
                            }

                        }

                        for (let i = 0; i < this.datasasd.length; i++) {
                            if(this.datasasd[i].dingdanStar=='5'){
                                c++;
                            }
                        }


                        for (let i = 0; i < this.datasasd.length; i++) {
                            if(this.datasasd[i].dingdanStar=='5'&&this.datasasd[i].purstate=='1'){
                                b++;
                            }
                        }

                        this.aaaa = a;
                        this.bbbb = b;
                        this.cccc = c;



                    })
                },
                chaxunselectcaigoudingan(){
                    let shihoujinhuo = "进货";
                    axios.get("chaxunselectcaigoudingan?pageNo="+this.pageNo+"&pageSize="+this.pageSize+"&shihoujinhuo="+shihoujinhuo).then(({data})=>{
                        this.datasasd = data.obj.list;
                        this.heights = data.obj.list.length*48+40;
                        if(this.heights==0){
                            this.heights = 100;
                        }
                        this.totals = data.obj.tatle;
                        this.shanchusuoyou()

                        <%--<i-table :row-class-name="classname" :height="heights" style="margin-top:20px;margin-right: 50px;" :data="datasasd" :columns="colunmsss" border>--%>
                        <%--<template slot="caozuo" slot-scope="{row}">--%>
                        <%--<i-button size="small" type="primary" @click="chakan(row)" icon="md-albums">查看</i-button>--%>
                        <%--<i-button type="primary" size="small" @click="exportData('pdf',row)">打印</i-button>--%>
                        <%--<i-button type="primary" size="small" @click="exportData('xls',row)">导出</i-button>--%>
                        <%--<shiro:hasPermission name="caigouyuande:yuanyin">--%>
                        <%--&lt;%&ndash;只能是采购员&ndash;%&gt;--%>
                        <%--<i-button v-if="row.dingdanStar=='1'" size="small" type="error" @click="geilingdaotiajiao(row)">提交</i-button>--%>
                        <%--<i-button v-if="row.dingdanStar=='3'" size="small" type="error" @click="caigouwanbi(row)">采购完毕</i-button>--%>
                        <%--</shiro:hasPermission>--%>

                        let a = 0;
                        let b = 0;
                        let c = 0;
                        for (let i = 0; i < this.datasasd.length; i++) {
                            // console.log(this.datasasd[i].dingdanStar)
                            // console.log(this.datasasd[i].purstate)
                            if(this.datasasd[i].dingdanStar=='1'){
                                a++;
                            }

                        }
                        for (let i = 0; i < this.datasasd.length; i++) {
                            if(this.datasasd[i].dingdanStar=='5'&&this.datasasd[i].purstate=='1'){
                               b++;
                            }
                        }
                        for (let i = 0; i < this.datasasd.length; i++) {
                            if(this.datasasd[i].row.dingdanStar=='5'){
                                c++;
                            }
                        }

                        this.aaaa = a;
                        this.bbbb = b;
                        this.cccc = c;

                    })
                },
                shanchusuoyou() {
                    axios.get("deldelxunigouwu").then(({data}) => {
                        _this.yaopinshuju = [];
                    })
                },
                clear(){
                    this.shanchusuoyou();
                },
                chakan(row){
                    location.href='/zhuangeanye?ids='+row.cgoId+"&a=1";
                },
                zhijianzhijian(row){
                    //质检员质检
                    this.zhijians = row;
                    // console.log(row)
                    this.shouhideasdasdasdadas = true;
                },
                onokshouhideasdasdasdadas(){
                    this.zhijianss.cgoId = this.zhijians.cgoId;
                    // this.zhijianss.qualComment = this.zhijianss.qualComment +"--第一次质检!"
                    axios.post("zhijianyuanjiance",this.zhijianss).then(({data})=>{
                        iview.Message.info(data.msg);
                        this.chaxunselectcaigoudingan();
                        this.zhijianss = {};
                        this.zhijians.disabledtrue = true;
                        this.zhijians.disabledtruess = "质检完毕";
                    })
                },
                jiaohuo(row){
                    axios.get("jiaoguoriqi?ids="+row.cgoId).then(({data})=>{
                        iview.Message.warning(data.msg)
                        this.chaxunselectcaigoudingan();
                    })
                },
                 onokshouhideasdas(){
                    this.zhiji.comment = this.zhijian.comment;
                     this.zhiji.dingdanStar = 4;
                     axios.post("/jiyulingdaotijiao",this.zhiji).then(({data})=>{

                    })
                },
                // zhijianzaicishnehe(row){
                //     this.zhiji = row;
                //     this.shouhide = true;
                // },
                tuihuo(row){
                    axios.post("/tuihuossss",row).then(({data})=>{
                        iview.Message.warning(data.msg)
                        this.chaxunselectcaigoudingan();
                    })
                },
                geilingdaotiajiao(row){
                    row.dingdanStar = 2;
                    axios.post("jiyulingdaotijiao",row).then(({data})=>{
                        iview.Message.warning(data.msg)
                        this.chaxunselectcaigoudingan();
                    })
                },
                pizhun(row){
                    row.dingdanStar = 3;
                    axios.post("jiyulingdaotijiao",row).then(({data})=>{
                        iview.Message.warning("审批成功!")
                        this.chaxunselectcaigoudingan();
                    })
                },
                bupizhun(row){
                    this.zhiji = row;
                    this.shouhide = true;
                },
                chakanyuanyinbupizhun(row){
                    this.chakanshouhide = true;
                    this.zhijian = row;
                },
                caigouwanbi(row){
                    row.dingdanStar = 5;
                    axios.post("jiyulingdaotijiao",row).then(({data})=>{
                        // iview.Message.warning("审批成功!")
                    })
                },
                exportData(fmt,row){
                    location.href = "/export?fmt="+fmt+"&gender="+row.cgoId;
                },
                classname(row,index){
                    if (row.dingdanStar === 1) {
                        return 'demo-table-info-row';
                    }else if (row.dingdanStar === 2) {
                        return 'demo-table-error-rows';
                    }else if (row.dingdanStar === 3) {
                        return 'demo-table-error-row';


                    //          <span v-if="row.dingdanStar=='3'">批准(可以采购)</span>
                    //         <span v-if="row.dingdanStar=='4'">不批准</span>
                    //         <span v-if="row.dingdanStar=='5'">采购完毕</span>
                    //         <span v-if="row.dingdanStar=='1'">未提交</span>
                    //         <span v-if="row.dingdanStar=='2'">已提交</span>
                    }else if (row.dingdanStar === 4) {
                        return 'demo-table-error-rowssss';
                    }
                }
            },
            mounted(){
                this.chaxunselectcaigoudingan();
                this.selectxunigouwu();
                this.xuanzeyaopinshujuasd();
                this.gongYingShangSelectFa();
                this.caigourens();
                this.leibies();
            },
            created(){
                _this = this;
            }






        })
    </script>
</body>
</html>
